﻿
Ext.override(Ext.form.Field, {
    initComponent: Ext.form.Field.prototype.initComponent.createSequence(function () {
        if (this.allowBlank != undefined && !this.allowBlank) {
            var composite_field = this.findParentByType('compositefield');
            if (composite_field) {
                composite_field.setFieldLabel(composite_field.fieldLabel + ' <font style="color:red">*</font>');
            } else {
                this.setFieldLabel(this.fieldLabel + ' <font style="color:red">*</font>');
            }
        }
    }),
    setFieldLabel: function (text) {
        if (this.rendered) {
            this.el.up('.x-form-item', 10, true).child('.x-form-item-label').update(text);
        }
        this.fieldLabel = text;
    }
});